<?php

    // +----------------------------------------------------------------------
    // | 腾讯云短信
    // +----------------------------------------------------------------------
    // | Copyright (c) 2015-2024 http://www.yicmf.com, All rights reserved.
    // +----------------------------------------------------------------------
    // | Author: 微尘 <yicmf@qq.com>
    // +----------------------------------------------------------------------

    namespace addon\qcloud_sms\controller;

    use yicmf\addon\controller\AdminController;
    use yicmf\builder\Edit;

    class Admin extends AdminController
    {
        // 默认配置
        public function config()
        {
            $config = $this->getConfig();
            $config['addon_name'] = $this->getName();
            $builder = new Edit();
            $builder->title('腾讯短信配置')
                ->keyHidden('addon_name')
                ->keyNumber('appid', 'appid', '1400开头')
                ->keyText('app_key', 'AppKey')
                ->keyTextInline('safe_code_template', '验证码模板')
                ->keyTextInline('cash_template', '提现模板')
                ->keyTextInline('sign_template', '模板签名')
                ->keyRadio('open', '开启短信功能', ['0' => '否', '1' => '是'])
                ->explain('腾讯短信 <a href="https://url.cn/tt7eC2XA" target="_blank" style="color: green">活动地址</a>')
                ->data($config)
                ->buttonSubmit();
            return $builder->fetch();
        }
    }
